1. Field of the Invention
The present invention relates generally to raster image manipulation, and more particularly to selecting specific raster image objects for manipulation.
2. Related Art
The manipulation and editing of a raster image generally involves several image processing operations that can be applied either to the entire image or to portions of it. For instance, FIG. 1A shows a raster image, and FIG. 1B shows the same raster image where the contrast of the entire image has been enhanced to make it more clear. In another example, FIG. 2A shows a raster image, and FIG. 2B shows the same image with only portions of the image (i.e. the van, part of the pedestrian crosswalk and the left turn arrow) enhanced to emphasize those portions of the image.
One difficulty in working with portions of raster images is that it is usually difficult to select an object precisely. There are several approaches to selecting an object. FIG. 3A shows an original raster image. FIG. 3B shows the raster image of FIG. 3A where a region corresponding to a rough approximation of the van object, in this case a rectangle, has been highlighted. FIG. 3C shows the more desirable method of contour selection of the van object, where only the area within the contour of the vehicle is highlighted.
There are conventional commercially available tools to assist in the selection of an individual object in a raster image, and these tools typically fall into three categories. In a first category, manual selection tools allow the user to select the object by drawing the outline of the shape to be selected. This method requires a steady hand on the part of the user, and occasionally requires more precision than can be obtained from common drawing hardware such as a mouse or drawing tablet. A second category includes semi-automatic tools that involve the user in guiding the computer's finding of the contour of the desired object. A third category includes automatic tools that can select an object automatically, for example by selecting all local areas similar in color to a user-selected point on the desired object. In this case, the user must usually select a color tolerance value to allow for variations in the color on the object.
Automatic tools are the easiest and fastest tools for the user, however, a great deal of trial and error is needed when the user sets the color tolerance value. Examples of automatic tools include the Magic Wand tool in Corel Photo-Paint®, available from Corel Corporation of Ottawa, Ontario, Canada, and the Magic Wand tool in Adobe PhotoShop®, available from Adobe Systems Inc. of San Jose, Calif.
These “magic wand” tools have several specific disadvantages. First, the size of the selected region is highly dependent on the value of the color tolerance chosen by the user. For instance, if the color tolerance value is too high, the resulting selected area will be too large (i.e. larger than the object to be selected), and the user has to reset the value and try again with a lower value. The selected area depends both on the color tolerance value and the seed location. Because the color value of a pixel is frequently different from the color value of its neighbors, the exact location of the seed area has a non-negligible effect on the size and shape of the resulting selected area. Therefore, because it is very difficult for a user to select the same seed area twice, due to pixel to pixel color variation, it often quite hard for a user to select the exact area he wants.
A second disadvantage is that the color tolerance value provided by the user is used as a range around the initial seed area or pixel selected. A pixel outside the selected region is added to that region if its color falls within the range of the seed color +/− the color tolerance value. Consequently, for such a technique to work well (i.e. to minimize the problems caused by the use of a +/− color tolerance), the user needs to select a seed pixel that falls in the center of the color interval of the pixels that compose the object to be selected. If the color of the seed selected by the user is not exactly in the center of that color interval, then the selected area might include undesired regions and, at the same time, exclude other regions that should have been selected. For instance, in a case where selection is based on color intensity only, if the color tolerance value is 10, and the user selects a seed area of intensity 25, then the selected area includes pixels with intensity ranging from 15 to 35. If the object to be selected had pixel intensities ranging from 20 to 40, then this selection is wrong, even though the intensity of the chosen seed falls within that interval. For such methods based on a color seed and a +/− color tolerance value to work well, the object to be selected must be surrounded by areas that are very different (in color) from the object to be selected.
Third, images often show shadows or variations in color intensity. Since automatic tools are often based on color intensity, they are very sensitive to such variations, and might exclude regions that have similar colors but that are different only because of variations of lighting conditions.
What is needed then is an improved method of selecting raster image objects that overcomes shortcomings of conventional solutions.